Store Locator Javascript Automation API - Shim Functions

Support > API Integration > Store Locator Javascript Automation API - Shim Functions

Introduction


Our store locator has a powerful Javascript based API interface which includes the Shim Functions described in this article. These functions allow you to replace built in functionality in the locator with your own code.


If these functions are present on the page, the locator will call them instead of it's internal functions.


Shim Functions

function storeLocatorBuildStoreInfoShim(store, settings, viewType) {
  return storeHTML;
}

This shim function can be used to replace the code which generates the HTML that is used to display each store entry. The function should return the HTML to be used by the locator to display the store.


store: (object) information about the store

settings: (object) the full set of locator settings

viewType: (string) can be one of either 'mapView' or 'listView'. This permits generating different HTML for the store information present in the store list vs in the map popup window.


function storeLocatorPlacesServiceResultShim(store) {
  return updatedStore;
}

This shim function can be used to add or modify the store data that is returned from the Google Places API before it is added to the store locator. The modified store object should be returned. For example, you could set a custom marker value for the Places API locations to more clearly denote them on the map.


store: (object) information about the store